/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dabarobjects.mobile.database.types;

/**
 *
 * @author DabarObjects Solutions Limited (www.dabarobjects.com)
 */
public class BooleanObjectNotationParser  extends AbstractMadexObjectNotationParser{

    private final static String KEY = "bl";
    public String getObjectTypeKey() {
        return KEY;
    }

    public Object parseObject(String dump) {
        if(dump.equalsIgnoreCase("t"))
            return Boolean.TRUE;
        return Boolean.FALSE;

    }

    public String notateObject(Object obj) {

        Boolean bool = (Boolean) obj;
        if(obj == null)
            return "{f}";
        if(bool.booleanValue())
            return "{t}";
        return "{f}";


    }

}
